//
//  ZCLButton.m
//  ZCLButton
//
//  Created by 徐益智 on 16/3/12.
//  Copyright © 2016年 Vdianjing. All rights reserved.
//

#import "UDButton.h"

#import "VDJConstant.h"

@implementation UDButton

- (CGRect)imageRectForContentRect:(CGRect)contentRect
{
    CGFloat w = self.frame.size.width;
    CGFloat margin = (w - self.imageWidth) / 2.0;
    
    return CGRectMake(margin, 2, self.imageWidth, self.imageWidth);
}

- (CGRect)titleRectForContentRect:(CGRect)contentRect
{
    CGFloat w = self.frame.size.width;
    CGFloat h = self.frame.size.height;
    
    return CGRectMake(0, kGetY(self.imageView.frame) + 2, w, h - 4 - self.imageWidth);
}

@end
